package ma.ac.onousc.gestionfi.budget.model.DAO;

import java.io.Serializable;
import java.util.List;

/**
 * An interface shared by all business data access objects.
 * <p>
 * All CRUD (create, read, update, delete) basic data access operations are
 * isolated in this interface and shared across all DAO implementations.
 * 
 * 
 * @author MEnnahdi
 * 
 * @param <T>
 * @param <ID>
 */
public interface GenericDAO<T, ID extends Serializable> {

	// read operation by primary key (@Id)
	T findById(ID id);

	// find all entities
	List<T> findAll();

	// create or update operations
	T makePersistent(T entity);

	// remove operation
	void makeTransient(T entity);

	void refresh(T entity);
}
